﻿#region << 文件说明 >>

/*----------------------------------------------------------------
 * 命名空间：Vampirewal.Core.MiniApi
 * 唯一标识：f01dafe9-498d-47ad-aeba-7f9f711ec3ac
 * 文件名：HttpRouterAttribute
 *
 * 创建者：杨程
 * 电子邮箱：235160615@qq.com
 * 创建时间：2023/12/18 9:56:07
 * 版本：V1.0.0
 * 描述：
 *
 * ----------------------------------------------------------------
 * 修改人：
 * 时间：
 * 修改说明：
 *
 * 版本：V1.0.1
 *----------------------------------------------------------------*/

#endregion << 文件说明 >>

namespace Vampirewal.Core.MiniApi;

/// <summary>
/// 标记为Controller
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public sealed class VampirewalControllerAttribute : Attribute
{
    /// <summary>
    ///
    /// </summary>
    public VampirewalControllerAttribute()
    {
    }

    /// <summary>
    /// 前缀
    /// </summary>
    public string Prefix { get; set; }

    /// <summary>
    /// 描述信息
    /// </summary>
    public string Description { get; set; }
}

/// <summary>
/// 标记为Api方法
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public sealed class HttpRouterAttribute : Attribute
{
    internal string path;
    internal HttpMethod httpMethod;

    public HttpRouterAttribute(HttpMethod httpMethod)
    {
        this.httpMethod = httpMethod;
    }

    public HttpRouterAttribute(string path, HttpMethod httpMethod)
    {
        this.path = path;
        this.httpMethod = httpMethod;
    }
}

public enum HttpMethod
{
    GET,
    POST,
    PUT,
    DELETE,
}